<template>
	<view class="description">
		<view v-html="showDesc"></view>
	</view>
</template>

<script>
	import{
		platformInfo
	} from '@/tool/http.js';
	export default {
		data() {
			return {
				status:'',  // 1关于我们  2隐私政策  3用户协议
				showDesc:'',
			};
		},
		onLoad(e){
			this.status = e.status;
			let title = '';
			if(e.status == '1'){
				title = '关于我们';
			}else if(e.status == '2'){
				title = '隐私政策';
			}else if(e.status == '3'){
				title = '用户协议';
			}
			uni.setNavigationBarTitle({
				title:title
			})
		},
		onShow(){
			this.getPlatformInfo();
		},
		methods:{
			async getPlatformInfo(){
				let res = await platformInfo({});
				console.log(res);
				if(res){
					if(this.status == '1'){
						this.showDesc = res.intro;
					}else if(this.status == '2'){
						this.showDesc = res.yinsi;
					}else if(this.status == '3'){
						this.showDesc = res.protocol;
					}
				}
			}
		}
	}
</script>

<style lang="scss">
	.description{
		width:100%;
		padding:12px;
		box-sizing: border-box;
	}
	page{
		background:white
	}
</style>
